package com.example.attendancesystem.Filter;/*
package com.example.demo.Filter;

import com.sun.deploy.net.HttpResponse;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

@Component
public class MyFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        Filter.super.init(filterConfig);
    }

    @Override
    public void doFilter(ServletRequest var1, ServletResponse var2, FilterChain var3) throws IOException, ServletException {
        HttpServletRequest httpServletRequest = (HttpServletRequest) var1;
        HttpServletResponse httpResponse = (HttpServletResponse) var2;
        HttpSession session = httpServletRequest.getSession();
        Object students = session.getAttribute("login");
        if (students == null){
            httpServletRequest.setAttribute("mess" ,"请登录!");
            httpServletRequest.getRequestDispatcher("/login").forward(httpServletRequest,httpResponse);
        }
    }

    @Override
    public void destroy() {
        Filter.super.destroy();
    }
}
*/
